using OrdersManager.Infrastructure.Interface;
using OrdersManager.Infrastructure.Interface.Constants;
using OrdersManager.Module.BusinessEntities;
using OrdersManager.Module.Views;
using SCSFContrib.CompositeUI.WinForms.SmartPartInfos;

namespace OrdersManager.Module.Workitems
{
    public class OrderWorkItemController : WorkItemController
    {
        private Order _order;

        public Order Order
        {
            get
            {
            	return _order;
            }
            set
            {
            	_order = value;
            }
        }

        private OrderMode _orderMode;
        
        public OrderMode OrderMode
        {
            get { return _orderMode; }
            set { _orderMode = value; }
        }
	

        public override void Run()
        {
            AddViews();
        }

        private void AddViews()
        {
            //Add items to workitem
            WorkItem.Items.Add(_orderMode, "OrderMode");
            WorkItem.Items.Add(_order, "Order");

            //Create a view and show it into workspace
            OrderView view = WorkItem.SmartParts.AddNew<OrderView>();
            WorkItem.Workspaces[WorkspaceNames.DockPanelWorkspace].Show(view);
        }
    }
}
